package com.java.tutorials.jdk7.paths;

import java.nio.file.FileSystems;
import java.nio.file.Path;

/**
 * Created by xuzhike on 2016/1/27.
 * http://www.java2s.com/Code/Java/JDK-7/GetSubpathfromafullpath.htm
 * Get Subpath from a full path
 */
public class GetSubpathfromafullpath {
    public static void main(String[] args) {
        Path path = FileSystems.getDefault().getPath("/home/docs/status.txt");
        System.out.printf("subpath(0,2): %s\n", path.subpath(0, 2));
        System.out.printf("getParent: %s\n", path.getParent());

    }
}
